"use client"; import { useRouter } from "next/navigation"; import { type FormEvent, useState } from "react"; import { useToast } from "@/components/Toast"; import { type ApiError, api } from "@/lib/client/api"; export function OverrideForm({ runId, gates }: { runId: string; gates: string[] }) { const router = useRouter(); const toast = useToast(); const [busy, setBusy] = useState(false); return (
) => { e.preventDefault(); setBusy(true); try { await api(`/api/admin/quality/${runId}/override`, { json: { rationale: new FormData(e.currentTarget).get("rationale") }, }); toast.push("success", "Override recorded; run now awaits explicit publication."); router.refresh(); } catch (err) { toast.push("error", (err as ApiError).message); } finally { setBusy(false); } }} >

Overriding: {gates.join(", ")}. The rationale is permanently recorded in the audit log and the publication decision.